package com.dinzeer.foxextra.regsiter;

import com.dinzeer.foxextra.Foxextra;
import mods.flammpfeil.slashblade.SlashBladeCreativeGroup;
import mods.flammpfeil.slashblade.init.SBItems;
import mods.flammpfeil.slashblade.item.ItemSlashBlade;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.RegistryObject;

import static com.dinzeer.foxextra.Foxextra.MODID;

public class FEXItemTab {
    public static final DeferredRegister<CreativeModeTab> REGISTRY = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, MODID);
    public static final RegistryObject<CreativeModeTab> Slashblade = REGISTRY.register("foxextra_slashblade",
            () -> CreativeModeTab.builder()
                    .withTabsBefore(SlashBladeCreativeGroup.SLASHBLADE_GROUP.getId())
                    .title(Component.translatable("item_group.foxextra.foxextra_slashblade")).icon(() -> {
                        ItemStack stack = new ItemStack(SBItems.slashblade);
                        stack.getCapability(ItemSlashBlade.BLADESTATE).ifPresent(s -> {
                            s.setTexture(Foxextra.prefix("model/foxex/texture3.png"));
                            s.setModel(Foxextra.prefix("model/foxex/model2.obj"));
                        });
                        return stack;
                    })
                    .displayItems((parameters, tabData) -> {

                    })
                    .build());
}
